/*
 * Copyright (c) 2019.
 * http://www.ulabcare.com
 */

package com.mt.roll.core.utils;

/**
 * <p>
 * 编号生成帮助类
 * 以2+8+6形式生成（2位编号类型前缀+8位年月日+6位自增序列号 ）
 * 2位编号类型前缀定义如下⤵
 * 1x：患者相关编号以 '1' 开头，(病例号:10 )
 * 2x：订单相关编号以 '2' 开头，如订单编号=20
 * 3x: 支付相关编号以 '3' 开头，如系统内部支付订单号=30
 * (未完待续...)
 * </P>
 *
 * @author FanYi
 * @date 2019-01-03
 * @since 1.0
 */
public class CodeGeneratorHelper {

    /**
     * 订单编号
     */
    public static final String ORDER_CODE = "ORDER_CODE";

    /**
     * 存储箱编号
     */
    public static final String STORAGE_BOX_CODE = "STORAGE_BOX_CODE";

    /**
     * 存储箱编号
     */
    public static final String AREA_CODE = "AREA_CODE";

    /**
     * 存储箱编号
     */
    public static final String EQUIPMENT_CODE = "EQUIPMENT_CODE";
    /**
     * 存储箱编号
     */
    public static final String PROCESS_FLOW_CODE = "PROCESS_FLOW_CODE";

    /**
     * 物料信息编号
     */
    public static final String MATERIAL_CODE = "MATERIAL_CODE";
    /**
     * 工艺设备点编号
     */
    public static final String PROCESS_FLOW_EQUIPMENT_CODE = "PROCESS_FLOW_EQUIPMENT_CODE";

    /**
     * 物料类型编号
     */
    public static final String MATERIAL_TYPE_CODE = "MATERIAL_TYPE_CODE";
    /**
     * 设备配方CODE
     */
    public static final String EQUIPMENT_RECIPE_CODE = "EQUIPMENT_RECIPE_CODE";
    /**
     * 物料信息编号
     */
    public static final String EQUIPMENT_MATERIAL_BOM_CODE = "EQUIPMENT_MATERIAL_BOM_CODE";
    /**
     * 报废类型编号
     */
    public static final String SCRAP_TYPE_INFORMATION_CODE = "SCRAP_TYPE_INFORMATION_CODE";
    /**
     * 报废原因编号
     */
    public static final String SCRAP_INFORMATION_CODE = "SCRAP_INFORMATION_CODE";
    /**
     * 权限 CODE
     */
    public static final String ROLE_CODE = "STORAGE_TANK_CODE";
    /**
     * 权限CODE
     *
     * @return 权限CODE
     */
    public static String getRoleCode() {
        return IDGenerator.gen("ROLE", "yyyyMMdd", 6, ROLE_CODE);
    }

    /**
     * 生成报废原因编号
     *
     * @return 编号
     */
    public static String getScrapInformationCode() {
        return IDGenerator.gen("BFYY", "yyyyMMdd", 6, SCRAP_INFORMATION_CODE);
    }
    /**
     * 生成设备物料Bom 编号
     *
     * @return 编号
     */
    public static String getEquipmentMaterialBomCode() {
        return IDGenerator.gen("SBWLBOM", "yyyyMMdd", 6, EQUIPMENT_MATERIAL_BOM_CODE);
    }
    /**
     * 生成设备配方编码
     *
     * @return 生成设备配方编码
     */
    public static String getEquipmentRecipeCode() {
        return IDGenerator.gen("SBPF", "yyyyMMdd", 6, EQUIPMENT_RECIPE_CODE);
    }
    /**
     * 生成物料类型编号
     *
     * @return 编号
     */
    public static String getMaterialTypeCode() {
        return IDGenerator.gen("WLLX", "yyyyMMdd", 6, MATERIAL_TYPE_CODE);
    }
    public static String getMaterialCode() {
        return IDGenerator.gen("WLXX", "yyyyMMdd", 6, MATERIAL_CODE);
    }
    /**
     * 生成工艺设备点CODE
     *
     * @return 工艺设备点CODE
     */
    public static String getProcessFlowEquipmentGroupCode() {
        return IDGenerator.gen("GYSBD", "yyyyMMdd", 6, PROCESS_FLOW_EQUIPMENT_CODE);
    }
    /**
     * 生成工艺编号
     *
     * @return 工艺编号
     */
    public static String getProcessFlowCode() {
        return IDGenerator.gen("GY", "yyyyMMdd", 6, PROCESS_FLOW_CODE);
    }
    /**
     * 生成订单编号
     *
     * @return 订单编号
     */
    public static String getOrderCode() {
        return IDGenerator.gen("20", "yyyyMMdd", 6, ORDER_CODE);
    }

    /**
     * 生成存储箱编号
     */
    public static String getStorageBoxCode(){return IDGenerator.gen("RQ", "yyyyMMdd", 6, STORAGE_BOX_CODE);}

    /**
     * 生成缓存区编号
     */
    public static String getAreaCode(){return IDGenerator.gen("HC", "yyyyMMdd", 6, AREA_CODE);}

    /**
     * 生成设备编号
     */
    public static String getEquipmentCode(){return IDGenerator.gen("EQ", "yyyyMMdd", 6, EQUIPMENT_CODE);}

    /**
     * 生成报废类型编号
     *
     * @return 编号
     */
    public static String getScrapTypeInformationCode() {
        return IDGenerator.gen("BFLX", "yyyyMMdd", 6, SCRAP_TYPE_INFORMATION_CODE);
    }
}
